package metier;

import java.io.Serializable;

public class Candidature implements Serializable {
	
	private static final long serialVersionUID = 6190919002365605842L;
	
	private int numCandidature = -1;
	private boolean valideEntreprise=false;
	private boolean valideDepartement=false;
	private boolean valideEtudiant=false;
	private int numEtudiant = -1;
	private int numStage = -1;
	
	
	public Candidature(int num, boolean ent, boolean dep, boolean etu, int numEtu, int numSta)
	{
		this.numCandidature = num;
		this.valideEntreprise = ent;
		this.valideDepartement = dep;
		this.valideEtudiant = etu;
		this.numEtudiant = numEtu;
		this.numStage = numSta;
	}
	
	public Candidature(boolean ent, boolean dep, boolean etu, int numEtu, int numSta)
	{
		this.valideEntreprise = ent;
		this.valideDepartement = dep;
		this.valideEtudiant = etu;
		this.numEtudiant = numEtu;
		this.numStage = numSta;
	}
	
	public Candidature(int numEtu, int numSta)
	{
		this.numEtudiant = numEtu;
		this.numStage = numSta;
	}
	
	public Candidature()
	{
		this.valideDepartement = false;
		this.valideEntreprise = false;
		this.valideEtudiant = false;
	}

	public int getNumCandidature() 
	{
		return numCandidature;
	}
	
	public boolean getValideEtudiant() 
	{
		return valideEtudiant;
	}

	public boolean getValideEntreprise() 
	{
		return valideEntreprise;
	}
	
	public boolean getValideDepartement() 
	{
		return valideDepartement;
	}
	
	public int getNumEtudiant() 
	{
		return numEtudiant;
	}
	
	public int getNumStage() 
	{
		return numStage;
	}
	
	public void setNumCandidature(int numCandidature) 
	{
		this.numCandidature = numCandidature;
	}

	public void setValideEntreprise(boolean valideEntreprise) 
	{
		this.valideEntreprise = valideEntreprise;
	}

	public void setValideDepartement(boolean valideDepartement) 
	{
		this.valideDepartement = valideDepartement;
	}

	public void setValideEtudiant(boolean valideEtudiant) 
	{
		this.valideEtudiant = valideEtudiant;
	}

	public void setNumEtudiant(int numEtudiant) 
	{
		this.numEtudiant = numEtudiant;
	}

	public void setNumStage(int numStage) 
	{
		this.numStage = numStage;
	}
	
	@Override
	public String toString() 
	{
		return "Candidature [Num = " + numCandidature + ", valid ent|dep|etu = " + valideEntreprise + "|" + valideDepartement + "|"
				+ valideEtudiant + ", NumEtudiant = " + numEtudiant + ", numStage = " + numStage + "]";
	}
	
	@Override
	public boolean equals(Object obj) {
		if(!(obj instanceof Candidature))
			return false;
		Candidature candidature = (Candidature) obj;
		if (this.getNumCandidature() == candidature.getNumCandidature())
			return true;
		return false;
	}
}
